﻿<phone:PhoneApplicationPage 
    x:Class="WP7Square.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="clr-namespace:WP7Square.Converters"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:local="clr-namespace:WP7Square"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="False"
    d:DataContext="{d:DesignData}"
>

        
    <phone:PhoneApplicationPage.Resources>
        <converters:BoolToStringConverter x:Key="stringConverter" />

    </phone:PhoneApplicationPage.Resources>


    <StackPanel x:Name="LayoutRoot" Background="{StaticResource BackgroundBrush}">

        <!--This is the name of the application and page title-->
        <StackPanel Margin="0 0 0 0" Height ="170">
            <TextBlock x:Name="ApplicationName" Text="Settings" Style="{StaticResource MainMenuItemTitleStyle}"/>
            <TextBlock x:Name="ExplanationText" 
                           Text="these are defaults, but you can choose different behaviour on each checkin. They don't actually work yet though."
                           TextWrapping="Wrap" 
                           Style="{StaticResource DoubleLineListSubTitleTextStyle}" 
                           Margin="10 10 0 0"/>
        </StackPanel>

        <Grid Margin="10 0 0 0">


            
                <ListBox x:Name="SettingsListView" Height="Auto" SelectionMode="Single" ItemsSource="{Binding Items}" SelectionChanged="ListView_SelectionChanged" Style="{StaticResource ListBoxStyle}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="206*" />
                                    <ColumnDefinition Width="274*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="50" />
                                    <RowDefinition Height="50" />
                                </Grid.RowDefinitions>

                                <TextBlock Margin="25,0,0, 0"
                                            Text="{Binding LineOne}"
                                            HorizontalAlignment="Left"
                                            Style="{StaticResource MainMenuSubItemTitleStyle}" 
                                            VerticalAlignment="Top" 
                                            Grid.Row="0" 
                                            Grid.ColumnSpan="2" 
                                 />

                                <TextBlock  x:Name="CheckboxTitle" 
                                            Text="{Binding ElementName=facebookCheckbox, Path=IsChecked, Converter={StaticResource stringConverter}, ConverterParameter='On,Off'}" 
                                            Style="{StaticResource ToggleItemStateTextStyle}"
                                            Grid.Row="1" 
                                />


                                <ToggleButton x:Name="facebookCheckbox" 
                                              Content="ToggleButton" Style="{StaticResource PhoneToggleSwitch}" 
                                              HorizontalAlignment="Right"
                                              Grid.Column="1" 
                                              Grid.Row="2"
                                              Height="95" 
                                              VerticalAlignment="Center"
                                              IsChecked="{Binding Source={StaticResource settingsViewModel}, Path=_eventHandler, Mode=TwoWay}" 
                                  />
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
        </Grid>
    </StackPanel>

</phone:PhoneApplicationPage>